class GameStart extends eui.UILayer {

    public constructor() {
        super();
        this.createView();
    }

    private createView(): void{
        let sky = Common.createBitmapByName("scenebg1_png");
        this.addChild(sky);
        sky.alpha = 0.2;
        sky.width = Const.SCENT_WIDTH;
        sky.height = Const.SCENT_HEIGHT ;

        let button_icon = Common.createBitmapByName("login2_png")
        let button = new eui.Button();
        button.label = "Click!";
        button.horizontalCenter = 0;
        button.verticalCenter = 0;
        button.icon = button_icon.texture;
        button.y = Const.SCENT_HEIGHT - 300;
        button.width = 80 ;
        button.height = 130;
        this.addChild(button);
        button.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onButtonClick, this);

        let textField = new egret.TextField();
        this.addChild(textField);
        textField.y = Const.SCENT_HEIGHT/2;
        textField.width = 480;
        textField.height = 100;
        textField.textAlign = "center";
        textField.text = "鸡飞狗打 bang！bang！bang！"
        textField.textColor = 0xEEEE00;
    }
    /**
     * 点击按钮
     * Click the button
     */
    private onButtonClick(e: egret.TouchEvent) {
        GameSceneManager.getInstance().repleaceScene(new GamePlay());
    }

}
